package oldFiles;
import lejos.nxt.*;
/**
 * A simple line follower for the LEGO 9797 car with
 * a single light sensor.
 * 
 * The light sensor should be connected to port 3. The
 * left motor should be connected to port C and the right 
 * motor to port B.
 * 
 * Variables initialized with a constant string are used 
 * in the LCD.drawString calls of the control loop to 
 * avoid garbage collection. 
 * 
 * @author  Ole Caprani
 * @version 22.08.08
 */
public class TachoTest {
	
	final static int FORWARD = 1;
	final static int BACKWARD = 2;
	final static int STOP = 3;
	final static int FLOAT = 4;
	//final int power = 80;
	final static int COURSECORRECTIONPOWER = 10;
	final static int FORWARDBASEPOWER = 70;

	public static void main (String[] aArg)
	throws Exception
	{
		MotorPort.A.controlMotor(0, FLOAT);
		MotorPort.B.controlMotor(0, FLOAT);
		MotorPort.C.controlMotor(0, FLOAT);
		TachoMeter tm= new TachoMeter();
		
		while (! Button.LEFT.isPressed())
		{
		}
	
		while (! Button.ESCAPE.isPressed())
		{
          tm.Update();
		  LCD.drawInt(tm.getBCount(), 0, 0); 
		  LCD.drawInt(tm.getCCount(), 0, 1); 
			
			
			
			Thread.sleep(1);
		}
		
		Thread.sleep(10000);
	}


}
 